# $Id: PKGBUILD 85453 2013-03-01 19:08:27Z andrea $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=qsopcast
pkgver=0.3.8
pkgrel=6
pkgdesc="A Qt front-end to p2p TV sopcast"
arch=('i686' 'x86_64')
url="http://code.google.com/p/qsopcast"
license=('GPL2')
depends=('qt4' 'sopcast')
source=("http://qsopcast.googlecode.com/files/${pkgname}-${pkgver}-qt4.tar.bz2"
        'qsopcast.desktop'
        'gcc47.patch')
sha1sums=('d0bb84bbc7d0e75fd1473a3ee8ddcf18ee5c43ca'
          'ada48f3fdeab903235967142740d057d544494c4'
          '96619ebf04b8c3f752d8e219785e13a68bb9e06c')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}-qt4/src"

  patch -p2 -i "${srcdir}"/gcc47.patch

  sed -i "s:/usr/local:/usr:g" qsopcast.pro main.cpp
  qmake-qt4
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}-qt4/src"

  make INSTALL_ROOT=$pkgdir install
  install -D -m644 $srcdir/qsopcast.desktop \
    $pkgdir/usr/share/applications/qsopcast.desktop
  rm -rf "${pkgdir}/usr/bin/sp-sc"
}
